import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import axios from 'axios'

// 配置axios默认基础URL
// 注意：chatService.js中使用了独立的axios实例，不受此配置影响
axios.defaults.baseURL = process.env.VUE_APP_API_BASE_URL || 'http://localhost:8081/api'

// 创建Vue应用实例
const app = createApp(App)

// 使用插件
app.use(router)
app.use(store)
app.use(ElementPlus)

// 将axios注入到全局属性中
app.config.globalProperties.$http = axios

// 挂载应用
app.mount('#app')